package com.wanwan.producer;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class ProcuderMessage {
    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send() {

        for (int i=0; i<10; i++) {
            amqpTemplate.convertAndSend("queue","消息发送"+i);
        }
    }
}
